<template>
    <div>
        <!--<component v-bind:is="currentView"></component>-->
        <success :sign-info="signInfo" v-if="isSuccess"></success>
        <empty v-else></empty>
    </div>

</template>

<script type="text/babel">
    import {getSignInDetail} from "../api/sign";
    import Success from './components/success'
    import Empty from './components/empty'

    export default {
        components: {
          Success,
          Empty
        },
        data() {
            return {
                btns: [],
                signInfo: {
                    scores: undefined,
                    serialNo: undefined,
                    name: undefined,
                    signTime: undefined,
                    idCard: undefined
                },
                isSuccess: true
            }
        },
        created() {
            this.getInfo();
        },
        methods: {
            getInfo() {
                getSignInDetail(this.$route.params.id).then(res => {
                    this.signInfo = res;
                }).catch(err => {
                    console.log(err.message);
                    this.isShow = false;
                    this.iconName = "empty_info";
                })
            }

        }
    }
</script>

<style scoped>
    .right-content-txt {
        color: black;
        font-size: large;
    }
</style>
